<h2><%= l(:label_statistics) %></h2>

<% content_for :header_tags do %>
  <%= bootstrap_load_base %>
  <%= high_charts_load_base %>
  <%= high_charts_load_module(:drilldown) %>

  <%= stylesheet_link_tag    'application',    plugin: 'redmine_git_hosting' %>
  <%= javascript_include_tag 'set_highcharts', plugin: 'redmine_git_hosting' %>
<% end %>

<div id="statistics-tabs">
  <ul>
    <li><a href="#statistics-global"><%= l(:label_repository_statistics_global) %></a></li>
    <li><a href="#statistics-commits"><%= l(:label_repository_statistics_commits) %></a></li>
    <li><a href="#statistics-contributors"><%= l(:label_repository_statistics_contributors) %></a></li>
  </ul>

  <div id="statistics-global">
    <%= render 'repositories/statistics/global', repository: @repository %>
  </div>

  <div id="statistics-commits">
    <%= render 'repositories/statistics/commits', repository: @repository %>
  </div>

  <div id="statistics-contributors">
    <%= render 'repositories/statistics/contributors', repository: @repository %>
  </div>

</div>

<div style="clear: both; margin: 10px;"></div>

<%= javascript_tag do %>
  $(document).ready(function() {
    createAreaChart(chart_commits_per_month);
    createZoomableAreaChart(chart_commits_per_day);
    createBarChart(chart_commits_per_hour);
    createPieChart(chart_commits_per_weekday);

    <% @author_charts.each do |chart| %>
    createZoomableAreaChart(<%= chart %>);
    <% end %>

    createColumnChart(chart_commits_per_author);

    $("#statistics-tabs").tabs();
  });
<% end %>

<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>

<% html_title(l(:label_repository), l(:label_statistics)) -%>
